//
//  User.swift
//  SinaWeibo
//
//  Created by 张子国 on 15/11/16.
//  Copyright © 2015年 张子国. All rights reserved.
//

import UIKit

class User: NSObject {

    //用户ID
    var id : Int = 0
    //好友显示名称
    var name : String?
    //用户头像地址 String
    var profile_image_url : String?
    //用户头像URL
    var headImage : NSURL {
       return NSURL(string: profile_image_url ?? "")!
    }
    //会员等级
    
    var member : Int = 0
    //会员图片
    var memberImage : UIImage? {
        if member > 0 && member < 7 {
            return UIImage(named: "common_icon_membership_level\(member)")
        }
        return nil
    }
    
    var verfied_type : Int = -1
    var verfied_type_Image : UIImage? {
        switch verfied_type {
        case 0:
            return UIImage(named: "avatar_vip")
        case 2,3,5 :
            return UIImage(named: "avatar_enterprise_vip")
        case 220:
            return UIImage (named: "avatar_grassroot")
        default:return nil
            
        }
    }
    
    //设置KVC 赋值
    init(dict:[String : AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    
}
